package com.guigu.controller.lq.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guigu.controller.lq.mapper.LqMakeMapper;
import com.guigu.controller.lq.mapper.LqXldfMapper;
import com.guigu.controller.lq.pojo.LqMake;
import com.guigu.controller.lq.pojo.LqPhysicaljg;
import com.guigu.controller.lq.pojo.PageVO;
import com.guigu.controller.lq.service.LqMakeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class LqMakeServiceimpl implements LqMakeService {
    @Autowired
    LqMakeMapper lqMakeMapper;

    public PageVO<LqMake> findfl(Integer page, Integer num, String vipname) {
        PageHelper.startPage(page,num);
        LqMake lqMake = new LqMake();
        lqMake.setVipname(vipname);
        List<LqMake> findfl = lqMakeMapper.findfl(lqMake);
        PageInfo<LqMake> pageInfo = new PageInfo<LqMake>(findfl);
        long total = pageInfo.getTotal();
        PageVO<LqMake> PageVO = new PageVO<LqMake>();
        PageVO.setTotal(total);
        PageVO.setRows(findfl);
        return PageVO;
    }

    public LqMake findyy(String vipid) {
        return lqMakeMapper.findyy(vipid);
    }

    public int uprq(LqMake lqMake) {
        return lqMakeMapper.updateByPrimaryKey(lqMake);
    }

    public List<LqMake> findgls(String vipid) {
        return lqMakeMapper.findgls(vipid);
    }

    public LqMake findid(Integer id) {
        return lqMakeMapper.findid(id);
    }
}
